package zcj.stu.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Catch implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("URL:"+request.getRequestURL());
//        Cookie[] cookies = request.getCookies();
//        for (int i = 0; i <cookies.length ; i++) {
//            System.out.println("cookie"+i+"-"+cookies[i].getName()+":"+cookies[i].getValue());
//        }
//        response.sendRedirect(request.getRequestURL().toString());
//        response.getHeader()
        return true;
    }
   /* szd: 黑龙江省哈尔滨市平房区平盛街道黑龙江东方学院

    yxid: 19
    dwlb: 精准定位
    xm: 朱传杰
    cardid: 20140141
    yxbm: 信息工程学院
    dksj: 2022-10-10 18:55:54
    dktw: 36.3℃~37.3℃
    jkzt: 正常
    sfgfx: 否
    lzdq:
    sfqzysbl: 否
    szdtext: 黑龙江省哈尔滨市平房区平盛街道黑龙江东方学院
    xrywz: 其他地区
    sfdym: 是
    sdzjsl: 三针
    cxqk: 无
    yszz: 无
    stzz: 无
    zjhsrq: 2022-10-10
    ssqy: 校外
    zjhsxxdz: 黑龙江东方学院
    agree: 1
https://ehall.hljeu.edu.cn/xglyw/_web/_apps/poe/mrdk/api/add.rst?domainId=1//打卡api
https://ehall.hljeu.edu.cn/xglyw/_web/_apps/poe/mrdk/dk.jsp?domainId=1
    cookie: SESSION=f7a11905-50cf-4bc7-ae8c-42a4cb59d066; CASTGC=eyJhbGciOiJIUzUxMiJ9.WlhsS2FHSkhZMmxQYVVwcllWaEphVXhEU214aWJVMXBUMmxLUWsxVVNUUlJNRXBFVEZWb1ZFMXFWVEpKYmpBdUxtbEVUV3QzY0daRlgyZHRPVk0yYjBOT2MyNTRXVUV1TWxBMFRFTnVXbGc0VEdOQ1VWbHJRMDluZWxVMlIwOTNPR3hPVURCdFpUbGhjMWhTWVc5c2Iyb3dZbUo1V1haR056bHFNVjh4V1VzNWVWZGtSa2hUTmtwdmMyWmhXVzFMVFhwemVVdDNiR2hWYWpaUFpGSnRRbTlYWDNaak1qTmZSVGxYTUhoalpVVlNUakl6UVVsRFprTmpjMTlvTTBwdE4xWk1VbkpRWm5WMFFsOHdZbWx0WVRrdGJHaFZTVEo1WVZkYVJsUnZUR2xGVURSNExUQmZSSFpEWjNNMFJYWnNWbWgzVjJoM1RIQXhWelZ5Y0dWaWNTMWlPVlpLYzJKdmJqbE9OMGxJTnpSUmJWaGtaVFUxVGtselYxQklUR1E1WTI1bFFrdHRiV2hsY2tkSlZIRXpWRkpMWkdnMGRUVnNVMDAwWVVwYVMydExWV3RWTFhJMVNrUm5OR280WVMwemFFTnBjRFpSVEVZelVHUlZSa2wxVEVwU2NIa3dRemx6TlZOVVZYaDJjbnA0V1RaTVVtcGtUVjlOU1RRMmJVbEdlbXhzYW1GZk4xTXViMVZaVDFkRFkyVjJXR3BzVFMxcWRtSTNURWRuVVE9PQ.PV_mebtLFRR_ai72nCClA53O-ulSQC_lI8OISiXhVO4Je9bQ31F1IER6JTMQ8ZKS7BALLieLToXm9quOXSU4-A; route=7aced69bf84787d8d695e1b33cfa1717; language=; sudycalendar=d58b55b0d204b36a8a1fc5dbc00b20b2; sduuid=d87fb9ba6c96f9efbb68b2512c076708; JSESSIONID=4C41B5243DDB956D9EBCD96660CF7177; sudyLoginToken=expired
    */
}
